import java.util.Scanner;

/**
 * @author zhoujunjie
 * @desc TODO
 * @date 2025/4/9
 */
public class Test02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = x/10;
        switch ( a ){
            case 10:
            case 9:
                System.out.println("A级");
                break;
            case 8:
                System.out.println("B级");
                break;
            case 7:
                System.out.println("C级");
                break;
            case 6:
                System.out.println("D级");
                break;
            case 5:
            case 4:
            case 3:
            case 2:
            case 1:
            case 0:
                System.out.println("不合格");
                break;
            default:
                System.out.println("输入不合法");
        }
    }
}
